package com.wwg.threads.itcast.demo;

public class TicketCellDemo {
    public static void main(String[] args) {
//        ticketCell();

        MovieTicketCellTask s8 = new MovieTicketCellTask(50, "速度与激情8");
        MovieTicketCellTask tt3 = new MovieTicketCellTask(60, "坦尼坦克号3D");
        MovieTicketCellTask r3 = new MovieTicketCellTask(100, "肉蒲团3D版");

        Thread t1 = new Thread(s8, "一号窗口（" + s8.getTicketType() + ")");
        Thread t2 = new Thread(s8, "二号窗口（" + s8.getTicketType() + ")");

        Thread t3 = new Thread(tt3, "一号窗口（" + tt3.getTicketType() + ")");
        Thread t4 = new Thread(tt3, "二号窗口（" + tt3.getTicketType() + ")");

        Thread t5 = new Thread(r3, "一号窗口（" + r3.getTicketType() + ")");
        Thread t6 = new Thread(r3, "二号窗口（" + r3.getTicketType() + ")");

        t1.start();
        t2.start();
        t3.start();
        t4.start();
        t5.start();
        t6.start();
    }


    private static void ticketCell() {
        // 多个卖票任务
        TicketCellTask ticketCellTask1 = new TicketCellTask(50,"飞机票");
        TicketCellTask ticketCellTask2 = new TicketCellTask(60,"火车票");

        // 窗口给任务 卖啥
        Thread t11 = new Thread(ticketCellTask1, "一号窗口（" + ticketCellTask1.getTicketType() + "）");
        Thread t12 = new Thread(ticketCellTask2, "一号窗口（" + ticketCellTask2.getTicketType() + "）");

        Thread t21 = new Thread(ticketCellTask1, "二号窗口（" + ticketCellTask1.getTicketType() + "）");
        Thread t22 = new Thread(ticketCellTask2, "二号窗口（" + ticketCellTask2.getTicketType() + "）");

        Thread t31 = new Thread(ticketCellTask1, "三号窗口（" + ticketCellTask1.getTicketType() + "）");
        Thread t32 = new Thread(ticketCellTask2, "三号窗口（" + ticketCellTask2.getTicketType() + "）");

        t11.start();
        t12.start();

        t21.start();
        t22.start();

        t31.start();
        t32.start();
    }
}
